import base64
import sys

# s = '代码'
# es = base64.b64encode(s.encode('utf-8')).decode("utf-8")
# print(es) # 5Luj56CB
#
# ds = base64.b64decode(es.encode('utf-8')).decode("utf-8")
# print(ds) # 代码

with open("./01.jpg.txt","rb") as f:
  # b64encode是编码，b64decode是解码
  base64_data = base64.b64encode(f.read())
  # base64.b64decode(base64data)
  print(base64_data)